import request from '@/utils/request'

// 查询资产列表
export const getEamList = (query) => {
  return request({
    url: '/eam/asset/list/',
    method: 'get',
    params:query
  })
}

// 查询资产列表
export const getInfoEam = (assetId) => {
  return request({
    url: '/eam/asset/'+ assetId,
    method: 'get',
    params:assetId
  })
}

// 查询资产类别列表
export const getTypeList = (query) => {
  return request({
    url: '/eam/asset/typeList/',
    method: 'get',
    params:query
  })
}

// 查询存放位置列表
export const getLocationList = (query) => {
  return request({
    url: '/eam/asset/locationList/',
    method: 'get',
    params:query
  })
}

// 新增资产
export const addEam = (data) => {
  return request({
    url: '/eam/asset/addEam',
    method: 'post',
    data:data
  })
}

// 资产图片上传
export function uploadImage(data) {
  return request({
    url: '/eam/file/image',
    method: 'post',
    data: data
  })
}

// 删除资产
export function delAsset(data) {
  return request({
    url: '/eam/asset/'+data,
    method: 'delete'
  })
}

// 入库
export function addStock(data) {
  return request({
    url: '/eam/stock',
    method: 'post',
    data:data
  })
}

// 修改资产
export const updateEam = (data) => {
  return request({
    url: '/eam/asset/edit',
    method: 'put',
    data:data
  })
}
